<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增总账户流水')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-infoHis-add">
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">账户ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="accountId" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">账户名称：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="accountName" class="form-control" type="text"  required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">账户姓名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="accountUser" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
            <input name="accountId" th:value="${accountId}"  class="form-control" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">入账图片：</label>
                <div class="col-sm-8">
                    <input name="imgUrl" id="imageUrl" class="form-control" type="hidden" required>
                    <input id="inputImage" name="file" type="file">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">操作类型：</label>
                <div class="col-sm-8">
                    <select name="actionType" class="form-control" required>
                        <option value="">请选择</option>
                        <option value="INCOME">收入</option>
                        <option value="ADJUST">调账</option>
<!--                        <option value="PAYOUT">支出</option>-->
<!--                        采量支出，公司运营，员工工资，员工提成，代理返点-->
                        <option value="CHANNEL_PAYOUT">采量支出</option>
                        <option value="COMPANY_PAYOUT">公司运营</option>
                        <option value="STAFF_SALARY">员工工资</option>
                        <option value="STAFF_PERCENT">员工提成</option>
                        <option value="AGENT_REBATE">代理返点</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">修改金额：</label>
                <div class="col-sm-8">
                    <input name="changeAmount" class="form-control" type="text" required>
                    <small class="text-muted">减少金额时，请在数字前面加上负号（例如：-100）。</small>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">数据id：</label>
                <div class="col-sm-8">
                    <input name="dataId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="dataRemark" class="form-control" type="text">
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "account/infoHis"
        $("#form-infoHis-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-infoHis-add').serialize());
            }
        }

        $(document).ready(function () {
            $("#inputImage").fileinput({
                uploadUrl: ctx + 'common/upload/bill',
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                $("#imageUrl").val(rsp.fileUrl)
                $("#imageUrl_img").attr("src", rsp.fileUrl)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
        });
    </script>
</body>
</html>